import {
    getExcel,
    get,
    post,
    postExcel
} from '../utils/request.js';
import axios from 'axios'

/* 管理员 */
/* 意向客户 */
export const add = (params) => post('/customer/purpose/addPurpose', params, 'notQs');
export const det = (params) => get('/customer/purpose/getPurposeDetails', params);
export const getC = (params) => get('/customer/purpose/getPurposeList', params);
export const delC = (params) => get('/customer/purpose/delCustomer', params);
export const upC = (params) => post('/customer/purpose/modifyCustomer', params, 'notQs');
//export const getAllC = (params) => get('/customer/company/getCompanysFromSour', params);
export const addToPurpose = (params) => get('/customer/purpose/addToPurpose', params);
export const getAllC = (params) => get('/customer/company/getCompanyByXydm', params);



/* 黑名单 */
export const addB = (params) => post('/customer/black/addBlackCustomer', params, 'notQs');
export const getB = (params) => get('/customer/black/getBlackList', params);
export const delB = (params) => get('/customer/black/delCustomer', params);
export const upB = (params) => post('/customer/black/updateBlackCustomer', params, 'notQs');

/* 白名单 */
export const addW = (params) => get('/customer/white/addToWite', params, 'notQs');
export const getW = (params) => get('/customer/white/getWhiteListFromSour', params);
export const moveToPurpose = (shtyxydms) => get('/customer/white/moveToPurpose?shtyxydms='+shtyxydms);
export const delW = (params) => get('/customer/purpose/delCustomer', params);
export const getT = (params) => get('/customer/white/getRecommendList', params);


/* 客户推荐 */
export const addR = (params) => get('/customer/white/addToWite', params, 'notQs');
export const getR = (params) => get('/customer/company/getRecommendList', params);
export const moveToPurposeFormRecmd = (shtyxydms) => get('/customer/white/moveToPurposeFormRecmd?shtyxydms='+shtyxydms);
export const moveToWhiteFormRecmd = (shtyxydms) => get('/customer/white/moveToWhiteFormRecmd?shtyxydms='+shtyxydms);




/* 工作台 */
export const getK = (params) => get('/customer/bind/getBindCustomerList', params);
export const assignC = (params) => post('/customer/bind/addCutstomerBinds', params, 'notQs');
export const upAssign = (params) => post('/customer/bind/upCutstomerBinds', params, 'notQs');
export const celC = (params) => get('/customer/bind/clearBind', params);
// 获取授权记录
export const getAuthRerd = (params) => get('/qyxx/authorize/getAuthRecordList', params);
export const getCmpAuthRecords = (params) => get('/qyxx/authorize/getCmpAuthRecords', params);

//批量授权协议上传
export const getBatchList = (params) => get('/qyxx/authorize/qysqxyBatch/list', params);//查询上传历史记录
export const listById = (params) => get('/qyxx/authorize/qysqxyBatch/listById', params);//查看


// 获取授权协议列表
export const getAuthList = (params) => get('/qyxx/authorize/getAuthList', params);
export const getAuthMngList = (params) => get('/qyxx/authorize/getAuthMngList', params);
export const getListRecords = (params) => get('/qyxx/authorize/qysqxyBatch/listRecords', params);
export const getCmpBankInfo = (params) => get('/qyxx/authorize/getCmpBankInfo', params);
export const delCmpFile = (params) => post('/qyxx/authorize/delCmpFile', params);
export const addAuth = (params) => post('/qyxx/authorize/addAuth', params);
export const updateAuth = (params) => post('/qyxx/authorize/updateAuth', params);
export const submitAuth = (params) => post('/qyxx/authorize/submitAuth', params);
export const delAuth = (params) => post('/qyxx/authorize/delAuth', params);
export const searchAuthById = (params) => post('/qyxx/authorize/searchAuthById', params);
//授权记录·批量下载授权协议
export const allDownArea = (authIds) =>{
    return axios.get(process.env.VUE_APP_BASE_API  +'/qyxx/authorize/downLoadSqxys?authIds=' + authIds, {
      responseType: 'blob', // 或者responseType: 'blob'
    })
  }
export const downLoadSqxys = (params) => get('/qyxx/authorize/downLoadSqxys', params);
export const downloadTemp = (params) => getExcel('/qyxx/authorize/downloadTemp', params);

//授权协议审核
export const updateApproveAuth = (params) => post('/qyxx/authorize/updateApproveAuth', params);
export const updateApprOpenSatus = (params) => post('/qyxx/authorize/updateApprOpenSatus', params);


/* 客户经理 */
export const addOrder = (params) => post('/order/orderBase/storageOrder', params, 'notQs'); // 订单暂存
export const pubOrder = (params) => post('/order/orderBase/publishOrder', params, 'notQs'); // 订单发布
// export const upOrder = (params) => post('/order/orderBase/updateOrder/' + params, 'notQs');
export const orderDet = (params) => get('/order/orderBase/getDetail', params);
export const delOrder = (params) => post('/order/orderBase/delete', params);

/* 客户经理管理 */
export const addCUser = (params) => post('/managers-server/manager/addManager', params, 'notQs');
export const upCUser = (params) => post('/managers-server/manager/updateManager', params, 'notQs');
export const delCUser = (params) => post('/managers-server/manager/deleteManager', params);
export const getCUser = (params) => get('/managers-server/manager/getList', params);

export const getOrder = (params) => get('/order/orderBase/getOrderList', params); //订单列表
export const getCustomer = (params) => get('/customer/bind/getManagerBindList', params); //公司列表
export const companyDet = (params) => get('/customer/purpose/getPurposeDetails', params); //公司列表


// 额度查询  风险预警
export const searchLimit = (params) => post('', params);
export const limitDet = (params) => get('', params);
//平台管理员风险预警查询
export const searchRiskWarning = (params) => get("/qyxx/jrfkFxyj/getFxyjList", params);
//其他用户风险预警查询
export const searchRiskWarningForManage = (params) => get("/qyxx/jrfkFxyj/getFxyjListKeHu", params);
export const getYjxqList = (params) => post("/qyxx/jrfkFxyj/getYjxqList", params);
// 获取担保情况
export const getGuaranteeSituation = (params) => get("/qyxx/jrfkFxyj/getGuaranteeSituation", params);
// 获取贷款情况
export const getLoanSituation = (params) => get("/qyxx/jrfkFxyj/getLoanSituation", params);
// 获取预警信息
export const getWarnInfo = (params) => get("/qyxx/jrfkFxyj/warningInformation", params);
// 获取舆情信息
export const getYqxxList = (params) => get("/qyxx/jrfkFxyj/getYqxxList", params);

// 获取预警分布
export const getYjfb = (params) => get("/qyxx/jrfkFxyj/getYjfb", params);
// 获取风险等级分布
export const getFxdj = (params) => get("/qyxx/jrfkFxyj/getFxdj", params);
// 获取预警趋势
export const getYjqs = (params) => get("/qyxx/jrfkFxyj/getYjqs", params);

// 获取贷款余额趋势
export const getDkyeTrend = (params) => get("/qyxx/jrfkFxyj/getDkyeTrend", params);

/* 企业分析 */
export const qyfx = (params) => get('/qyxx/wxrz/qyfx', params);


export const riskDet = (params) => get('', params);

//融资管理
//获取金融产品列表
export const getRzcpList = (params) => post('/finasm/rzcp/pc/selectRzcp', params, 'notQs');
export const selJrzc = (params) => post('/finasm/jrzc/selJrzc', params, 'notQs');
export const addRzcp = (params) => post('/finasm/rzcp/pc/addRzcp', params, 'notQs');
export const updateRzcp = (params) => post('/finasm/rzcp/pc/updateRzcp', params, 'notQs');
export const downRzcp = (params) => post('/finasm/rzcp/pc/downRzcp', params);
export const showRzcp = (params) => post('/finasm/rzcp/pc/showRzcp', params);
export const delRzcp = (params) => post('/finasm/rzcp/pc/delRzcp', params);
export const getJrNoRzApprove = (params) => post('/finasm/rzsq/pc/jrNoRzApprove', params, 'notQs');
export const getPCQyrzList = (params) => get('/finasm/jrcsqyrz/getPCQyrzList', params, 'notQs');
export const jrNoYxApprove = (params) => post('/finasm/rzsq/pc/jrNoYxApprove', params, 'notQs');
export const zxNoRzApprove = (params) => post('/finasm/rzsq/pc/zxNoRzApprove', params, 'notQs');
export const zxNoYxApprove = (params) => post('/finasm/rzsq/pc/zxNoYxApprove', params, 'notQs');
export const getJrIsRzApprove = (params) => post('/finasm/rzsq/pc/jrIsRzApprove', params, 'notQs');
export const jrIsYxApprove = (params) => post('/finasm/rzsq/pc/jrIsYxApprove', params, 'notQs');
export const zxIsRzApprove = (params) => post('/finasm/rzsq/pc/zxIsRzApprove', params, 'notQs');
export const zxIsYxApprove = (params) => post('/finasm/rzsq/pc/zxIsYxApprove', params, 'notQs');
export const jrRefuse= (params) => post('/finasm/rzsq/pc/jrRefuse', params, 'notQs');
export const jrPass= (params) => post('/finasm/rzsq/pc/jrPass', params, 'notQs');
export const zxRefuse= (params) => post('/finasm/rzsq/pc/zxRefuse', params, 'notQs');
export const zxPass= (params) => get('/finasm/rzsq/pc/zxPass', params, 'notQs');
export const zxRzPass= (params) => get('/finasm/rzsq/pc/zxRzPass', params, 'notQs');
export const jrOver= (params) => post('/finasm/rzsq/pc/jrOver', params, 'notQs');
export const getLiuc= (params) => get('/finasm/rzsq/getLiuc', params, 'notQs');
export const addJrzc= (params) => post('/finasm/jrzc/addJrzc', params, 'notQs');
export const getBank= (params) => post('/finasm/rzcp/getBank', params, 'notQs');
export const zxYxPass= (params) => post('/finasm/rzsq/pc/zxYxPass', params, 'notQs');
export const updJrzc= (params) => post('/finasm/jrzc/updJrzc', params, 'notQs');
export const delJrzc= (params) => get('/finasm/jrzc/delJrzc', params, 'notQs');
export const getDict= (params) => get('/finasm/rzcp/getDict', params, 'notQs');
export const getFile = (params) => get('/finasm/jrzc/getFile', params, 'notQs');
export const updateFile = (params) => post('/finasm/jrzc/updateFile', params, 'notQs');
//金融机构结清接口
export const jrBack = (params) => post('/finasm/rzsq/pc/jrBack', params, 'notQs');


//根据社会统一信用代码、手机号,查看认证信息
export const searchRzxx= (params) => post('/finasm/jrcsqyrz/searchRzxx', params);
//更新状态
export const updateRzxx= (params) => post('/finasm/jrcsqyrz/updateRzxx', params);
//已审批 查看认证记录
export const searchRzxxDetail= (params) => post('/finasm/jrcsqyrz/searchRzxxDetail', params);
// 江苏银行随e贷申请记录
export const getJsBankData = (params) => get('/finasm/jsyhpriv/wxUsrQuery',params,'notQs')




//下载审批
//查询
export const getApproveList = (params) => get('/qyxx/reportAppro/getApproveList', params);
//审批下载申请
export const updateApprove = (params) => post('/qyxx/reportAppro/updateApprove', params);


//企业白名单
//名单匹配页面
//模板下载
export const expCtmp = (params) => getExcel('/customer/white/downloadTemp', params);
//表格数据
export const getTableDataList = (params) => post('/customer/jrfkBmdsxQy/getPages', params);
//自动导出
export const exportExcel = (params) => postExcel('/customer/jrfkWhitelistZb/export.do', params);
//手动导出
export const jrfkWhitelistZbHis = (params) => postExcel('/customer/jrfkWhitelistZbHis/export.do', params);


//风险预警管理模块
//查询是否监控
export const getIsJk = (params) => get('/qyxx/jrfkFxyjRelationship/queryRelationship', params);
//风险监控
export const addRelationship = (params) => post('/qyxx/jrfkFxyjRelationship/addRelationship', params);
//取消风险监控
export const deleteRelationship = (params) => post('/qyxx/jrfkFxyjRelationship/deleteRelationship', params);
//消息中心页面
//查询风险预警消息设置
export const getSettingInfo = (params) => post('/qyxx/jrfkFxyjSetting/getSettingInfo', params);
//保存风险预警消息设置
export const saveSettingInfo = (params) => post('/qyxx/jrfkFxyjSetting/saveSettingInfo', params,'notQs');
//风险预警消息列表
export const getPushHistory =(params) => get('/qyxx/jrfkFxyjPushHistory/getPushHistory',params)
//消息单条已读
export const jrfkFxyjPus =(params) => get('/qyxx/jrfkFxyjPushHistory/updateHistoryReaded',params)
export const updateQyhxHistoryReaded =(params) => get('/qyxx/jrfkFxyjPushHistory/updateQyhxHistoryReaded',params)
//消息全部已读
export const updateUserHistoryReaded =(params) => get('/qyxx/jrfkFxyjPushHistory/updateUserHistoryReaded',params)


//预警推送记录 
export const getAllPushHistory =(params) => get('/qyxx/jrfkFxyjPushHistory/getAllPushHistory',params)

//风险监控 
export const getQYPushHistory =(params) => get('/qyxx/jrfkFxyjPushHistory/getQYPushHistory',params)
export const getEsPushHistory =(params) => get('/qyxx/EasyEs/getPushHistory',params)
//风险等级图标 
export const getLevelChart =(params) => get('/qyxx/jrfkFxyjPushHistory/getLevelChart',params)
//风险类型图标 
export const getTypeChart =(params) => get('/qyxx/jrfkFxyjPushHistory/getTypeChart',params)
//操作2风险动态查询
export const getQyfx =(params) => get('/qyxx/jrfkFxyjPushHistory/getQyfx',params)

//企业风险
export const getQyfxByLoginName =(params) => get('/qyxx/jrfkFxyjPushHistory/getQyfxByLoginName',params)
//画像关联风险 
export const getQyglfx =(params) => get('/qyxx/jrfkFxyjPushHistory/getQyglfx',params)
//主动获取
export const getWebSocketInfo = (params) => get('/qyxx/jrfkFxyjPushHistory/getWebSocketInfo',params)














